package com.hnevc.caoliuye;

import java.util.Random;

/**
 * Math类（数学操作类）和Random类（在指定范围内产生随机数）
 */
public class Example02 {
    public static void main(String[] args) {
        System.out.println("绝对值"+Math.abs(-20));
        System.out.println("求大于参数的最小整数"+Math.ceil(5.6));
        System.out.println("求小于参数的最大整数"+Math.floor(5.6));
        System.out.println("四舍五入"+Math.round(10.56));
        System.out.println("求两个数的较大值"+Math.max(12.12,5.18));
        System.out.println(Math.random());
        System.out.println(10*10*10*10*10*10*10*10*10*10*10*10*10*10*10*10);
        Random random = new Random();
        System.out.println(random.nextInt(10));
        Random random1 = new Random(2);
        System.out.println(random1.nextInt(10));
        System.out.println(random.nextFloat());
    }
}
